package com.base.cn.platform.os.listener;

import com.base.cn.platform.os.common.RedissonQueue;
import lombok.extern.slf4j.Slf4j;
import net.oschina.j2cache.cache.support.util.SpringUtil;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 系统启动完成时的监听器
 * //implements ApplicationListener<ApplicationFailedEvent> 这是启动失败的监听器
 * @author s.li
 * @date 2019/03/06
 */
@Component
@Slf4j
public class ApplicationReadyEventListener implements ApplicationListener<ApplicationReadyEvent> {

    @Override
    public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
        log.info("=========================基础系统启动完成======================");
        //启动队列
        RedissonQueue redissonQueue = SpringUtil.getBean(RedissonQueue.class);
        redissonQueue.getQueue();
    }
}
